#pragma once

#include <memory>
#include <AMQPcpp.h>

class rabbitmqplus{
public:
    AMQPExchange *ev=0,*er=0;
    AMQPQueue *qe,*qr;
    std::shared_ptr<AMQP> amqp;
    static std::shared_ptr<rabbitmqplus> _inst;
    static std::shared_ptr<rabbitmqplus> inst(){
        if(_inst==nullptr)
            _inst.reset(new rabbitmqplus());
        return _inst;
    }
    bool publish(std::string topic,std::string msg);
private:
    rabbitmqplus();

    std::mutex mtx;
};